<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 作业1，本地存储你同学的所有的信息（用对象统计），再取出来，修改名字然后删除性别，再更新存储本地
      let obj = {
        username: '阿龙',
        age: 18,
        sex: '男',
      }
      // 存
      localStorage.setItem('str', JSON.stringify(obj))
      // console.log(JSON.stringify(obj))
      // 取
      const res = JSON.parse(localStorage.getItem('str'))
      console.log(res)

      // 改
      res.username = '张三'
      console.log(res)
      // 删
      delete res.sex
      localStorage.setItem('str', JSON.stringify(res))
     console.log(JSON.stringify(res))
    </script>
  </body>
</html>
